package com.runchamp.util;

import android.widget.TextView;

import com.runchamp.R;

/**
 * Created by User on 1/15/2015.
 */
public class DistanceCircleView {
    public static void setCircle(String distance, de.hdodenhof.circleimageview.CircleImageView circleImageView, TextView distanceTextView, TextView unitTextView) {
        double distanceDouble = Double.parseDouble(distance);

        if (distanceDouble == 1) {
            circleImageView.setImageResource(R.color.distance_circle_1);
            distanceTextView.setText("1");
            unitTextView.setText("km");
        } else if (distanceDouble == 2) {
            circleImageView.setImageResource(R.color.distance_circle_2);
            distanceTextView.setText("2");
            unitTextView.setText("km");
        } else if (distanceDouble == 3) {
            circleImageView.setImageResource(R.color.distance_circle_3);
            distanceTextView.setText("3");
            unitTextView.setText("km");
        } else if (distanceDouble == 4) {
            circleImageView.setImageResource(R.color.distance_circle_4);
            distanceTextView.setText("4");
            unitTextView.setText("km");
        } else if (distanceDouble == 5) {
            circleImageView.setImageResource(R.color.distance_circle_5);
            distanceTextView.setText("5");
            unitTextView.setText("km");
        } else if (distanceDouble == 6) {
            circleImageView.setImageResource(R.color.distance_circle_6);
            distanceTextView.setText("6");
            unitTextView.setText("km");
        } else if (distanceDouble == 8) {
            circleImageView.setImageResource(R.color.distance_circle_8);
            distanceTextView.setText("8");
            unitTextView.setText("km");
        } else if (distanceDouble == 10) {
            circleImageView.setImageResource(R.color.distance_circle_10);
            distanceTextView.setText("10");
            unitTextView.setText("km");
        } else if (distanceDouble == 0.1) {
            circleImageView.setImageResource(R.color.distance_circle_01);
            distanceTextView.setText("100");
            unitTextView.setText("m");
        } else if (distanceDouble == 0.2) {
            circleImageView.setImageResource(R.color.distance_circle_02);
            distanceTextView.setText("200");
            unitTextView.setText("m");
        } else if (distanceDouble == 0.5) {
            circleImageView.setImageResource(R.color.distance_circle_05);
            distanceTextView.setText("500");
            unitTextView.setText("m");
        }
    }

}
